package com.example.reagent_management.ui.setting;

import android.util.Log;
import android.view.View;

public class LogUtils {

    public static void  log(View view){
        Log.e("ASM_TEST", "log: 插入的代码");
    }

//    public static void  log(Object text, View view){
//       log(text, view,null);
//    }

    public static void  log(Object text, Object data){
        try {
            String toastText;
            if (text instanceof String) {
                toastText = (String) text +"\n";
            } else {
                toastText = text.toString()+"\n";
            }
            if (data != null) {
                toastText += data.toString()+"\n";
            }
            Log.e("ASM_TEST", "log: "+toastText);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void  log(Object text, Object data,Object file){
        try {
            String toastText;
            if (text instanceof String) {
                toastText = (String) text +"\n";
            } else {
                toastText = text.toString()+"\n";
            }
            if (data != null) {
                toastText += data.toString()+"\n";
            }
            if (file != null){
                toastText += file.toString();
            }
            Log.e("ASM_TEST", "log: "+toastText);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}